package demo;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: rei
 * Date: 2025-11-06
 * Time: 16:22
 */
public class Test {
    public static void main(String[] args) throws InterruptedException {
        MyTimer mt = new MyTimer();
        //这里可以用lambda表达是因为我直接用了runnable接口
        mt.schedule(() -> {
            System.out.println("马上就执行11111");
        },0);
        mt.schedule(() -> {
            System.out.println("马上就执2222");
        },0);
        mt.schedule(() -> {
            System.out.println("马上就执行3333");
        },0);
        mt.schedule(() -> {
            System.out.println("1111111111");
        },1000);
        mt.schedule(() -> {
            System.out.println("222222222");
        },2000);
        mt.schedule(() -> {
            System.out.println("33333333333");
        },3000);

    }
}
